import { updateData, ifPlayerData, ifPosition} from "./dataBase";

export class playerData {

    constructor(){

    }

    private _data: ifPlayerData;

    public get data() {
        return this._data;
    }
    @updateData("PLAYER_DATA")
    public DATA(data:ifPlayerData){
        this._data = data;
        return this._data;
    }
    @updateData("PLAYER_DATA", "HP")
    public HP(amount: number){
        this._data.hp = amount;
        return this._data.hp;
    }
    @updateData("PLAYER_DATA", "HP")
    public HP_OPR(amount: number){
        this._data.hp += amount;
        return this._data.hp;
    }
    @updateData("PLAYER_DATA", "MAX_HP")
    public MAX_HP(amount:number){
        this._data.maxHp = amount;
        return this._data.maxHp;
    }
    @updateData("PLAYER_DATA", "LEVEL")
    public LEVEL(amount:number){
        this._data.level = amount;
        return this._data.level;
    }
    @updateData("PLAYER_DATA", "POSITION")
    public POSITION(pos:ifPosition){
        this._data.pos = pos;
        return pos;
    }
    @updateData("PLAYER_DATA", "EXP")
    public EXP(amount:number){
        this._data.exp = amount;
        return this._data.exp;
    }
    @updateData("PLAYER_DATA", "EXP")
    public EXP_OPR(amount: number){
        this._data.exp += amount;
        return this._data.exp;
    }
    @updateData("PLAYER_DATA", "NEXT_EXP")
    public NEXT_EXP(amount:number){
        this._data.nextExp = amount;
        return this._data.nextExp;
    }
}
